//
//  Utilties.h
//  mendianjieke
//
//  Created by 响当当 on 7/30/19.
//  Copyright © 2019 dongzheng. All rights reserved.
//

#import <Foundation/Foundation.h>


@interface Utilties : NSObject
/*
 ** 监控网络状态
 */
+ (void)monitorNetworking;

/**
 * 获取当前屏幕显示的viewcontroller
 */
+ (UIViewController *)getCurrentVC;

/**
 *    url跳转
 */
+ (void)openUrlSchedule:(NSString *)urlStr;

//创建label
+ (UILabel *)creatLabelWithFrame:(CGRect)Rect
                    textAligment:(NSTextAlignment)textAligment
                        textClor:(UIColor *)color
                        textFont:(CGFloat)size;
//创建button
+ (UIButton *)creatButtonWithFrame:(CGRect)Rect
                      textAligment:(UIControlContentHorizontalAlignment)textAligment
                              text:(NSString *)title
                          textClor:(UIColor *)color
                         buttonBGC:(UIColor *)bgcColor
                          textFont:(CGFloat)size
                            target:(id)vc
                            method:(SEL)method;

//电话号码
+ (BOOL)checkTel:(NSString *)mobileNumbel;

//这个函数就是将字典封装成转义的JSON字符串
+ (NSString *)toJSONString:(NSDictionary *)dict;

/*
 ** 提示操作
 */
+ (void)showAlertWithTitle:(NSString *)titleStr
                   content:(NSString *)eventStr
               buttonTitle:(NSString *)btnTitle
            cancelBtnTitle:(NSString *)cancelBtnTitle
          ConfirmWithBlock:(void(^__weak)(void))comfirm;

/*
 ** 提示操作,不含取消
 
 */
+ (void)showAlertWithTitle:(NSString *)titleStr
                   content:(NSString *)eventStr
               buttonTitle:(NSString *)btnTitle
          ConfirmWithBlock:(void(^__weak)(void))comfirm;

//时间戳转换成时间
+ (NSString *)getTime:(NSString *)time;

//获取当前年月
+ (NSString *)getYearAndMonth;

//JSON转字典
+(NSDictionary *)convertDicWithJSON:(NSString *)jsonStr;
//字典转JSON
+(NSString *)convertJSONWithDic:(NSDictionary *)dic;
@end
